package com.example.springboot.mapper;

import com.example.springboot.entity.CComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2022-04-09
 */
public interface CCommentMapper extends BaseMapper<CComment> {

    @Select("select c.*,u.nickname,u.profilepic from c_comment c left join user u on c.user_id = u.id " +
            "where c.creative_id = #{creative_id} order by id desc")
    List<CComment> getCommentsByCreative(Integer creative_id);

}
